/**
 * 数据导入管理初始化
 */
var ExcelUpload = {
    id: "ExcelUploadTable",	//表格id
    seItem: null,		//选中的条目
    table: null,
    layerIndex: -1
};

/**
 * 初始化表格的列
 */
ExcelUpload.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '主键id', field: 'id', visible: true, align: 'center', valign: 'middle'},
        {
            title: '文件名', field: 'filename', visible: true, align: 'center', valign: 'middle', formatter(value, row, index){
                return '<a href="/static/'+value+'">'+value+'</a>'
            }
        },
        {title: '上传时间', field: 'uploadtime', visible: true, align: 'center', valign: 'middle'}
    ];
};


$(function () {
    var defaultColunms = ExcelUpload.initColumn();
    var table = new BSTable(ExcelUpload.id, "/dataImport/list", defaultColunms);
    table.setPaginationType("client");
    ExcelUpload.table = table.init();


    //初始化上传控件
    var avatarUp = new $WebFileUpload("excelFile","/dataImport/uploadProduct");
    avatarUp.setUploadBarId("progressBar");
    avatarUp.init();
});
